import http from "../http/request"
const getbanner = () => { //轮播图
  return http({
    url: "home/swiperdata",
    method: 'get'
  })
}
const getcate = () => { //分类
  return http({
    url: "home/catitems",
    method: "get"
  })
}
const foolt = () => { //楼层
  return http({
    url: "home/floordata",
  })
}
const getrect = () => { //分类
  return http({
    url: "categories",
  })
}
const getdetail = () => { //分类
  return http({
    url: "goods/search",

  })
}
const getdetalilist = (goods_id) => { //详情
  return http({
    url: "goods/detail?goods_id=" + goods_id
  })
}
//用户登录
const getlogin = (params) => {
  return http({
    url: "users/wxlogin",
    data: params,
    method: "post"
  })
}
// 创建订单
const getday = (params) => {
  return http({
    url: "my/orders/create",
    data: params,
    method: "post"
  })
}
//支付
const day = (params) => {
  return http({
    url: "my/orders/req_unifiedorder",
    data: params,
    method: "post"
  })
}
// 支付状态
const days = (params) => {
  return http({
    url: "my/orders/chkOrder",
    data: params,
    method: "post"
  })
}

// 订单查询
const order = (params) => {
  return http({
    url: "my/orders/all",
    data: params,
    method: "get"
  })
}
export {
  order,//订单查询
  days,//支付状态
  day,//支付
  getday,//创建订单
  getlogin,
  getbanner,
  getcate,
  foolt,
  getrect,
  getdetail,
  getdetalilist
}